<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arrs=["red","green","blue"];
        var user={
            name:"tom",
            age:20
        };
        // for(let i in arrs){
        //     // console.log(i);//索引
        //     console.log(arrs[i]);
        // }
        // for(let i in user){
        //     // console.log(i);//属性名
        //     console.log(user[i]);
        // }

        for(let i of arrs){
            console.log(i);//元素值
           
        }
        for(let i in user){
            console.log(i,user[i]);
           
        }
    </script>
</head>
<body>
    
</body>
</html>